<%@ include file="/common/taglibs.jsp"%>
<%@ page language="java" errorPage="/error.jsp" pageEncoding="UTF-8"
	contentType="text/html;charset=utf-8"%>
	<authz:acl hasPermission="" domainObject=""></authz:acl>
<head>
   <meta name="Robots" contect="none">
</head>
<table width="100%" height="76" border="0" cellpadding="0"
	cellspacing="0">
	<tr>
		<td align="left" valign="top">


			<table width="99%" border="0" align="center" cellpadding="0"
				cellspacing="0">
				<tr>
					<td height="25" bgcolor="#5F9CD4" class="font01">
						&nbsp;&nbsp;&nbsp;系统&gt;&gt; 仓库管理&gt;&gt; 原料管理
					</td>
				</tr>
				<tr>
					<td height="8"></td>
				</tr>
			</table>
			<!---list begin--->
			<table width="99%" border="0" align="center" cellpadding="1"
				cellspacing="1" bgcolor="#CDCDCD">
				<tr>
					<td height="25" background="img/m-bt-bg01.gif" bgcolor="#FFFFFF"
						style="background-repeat: no-repeat; background-position: right">

						<table width="99%" border="0" align="center" cellpadding="0"
							cellspacing="0">
							<tr>
								<td width="2%" height="24">
									<img src="img/dian-1.gif" width="6" height="6" />
								</td>
								<td width="48%" class="btn02">
									原料列表
								</td>
								<td width="50%" align="right">
									<input type="button" style="margin-right: 5px"
										onclick="location.href='<c:url value="/editMaterial.html"/>'"
										value="<fmt:message key="button.add"/>" />
								</td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td valign="top" bgcolor="#F8F8F8">
						<title><fmt:message key="materialList.title" /></title>
						<c:out value="${buttons}" escapeXml="false" />

						<display:table name="materialList" cellspacing="0" cellpadding="0"
							id="material" pagesize="25" class="simple" requestURI="">


							<display:column property="belongDeptID" sortable="true"
								headerClass="sortable" titleKey="materialForm.belongDeptID" />
							<display:column property="sn" sortable="true"
								headerClass="sortable" titleKey="materialForm.sn" />
							<display:column property="title" sortable="true"
								headerClass="sortable" titleKey="materialForm.title" />
							<display:column property="types" sortable="true"
								headerClass="sortable" titleKey="materialForm.types" />
							<display:column property="source" sortable="true"
								headerClass="sortable" titleKey="materialForm.source" />
							<display:column property="provider" sortable="true"
								headerClass="sortable" titleKey="materialForm.provider" />
							<display:column property="price" sortable="true"
								headerClass="sortable" titleKey="materialForm.price" />
							<display:column property="unit" sortable="true"
								headerClass="sortable" titleKey="materialForm.unit" />
							<display:column property="intro" sortable="true"
								headerClass="sortable" titleKey="materialForm.intro" />
							<display:column property="initNum" sortable="true"
								headerClass="sortable" titleKey="materialForm.initNum" />
							<display:column property="planNum" sortable="true"
								headerClass="sortable" titleKey="materialForm.planNum" />
							<display:column sortable="true" headerClass="sortable"
								titleKey="materialForm.factNum">
								 
								<c:choose>

									<c:when test="${material.factNum<material.initNum}"> 
                                     <script type="text/javascript">
									 alert("<c:out value="${material.title}" />"+"缺货!");
									 </script>
									<font color=red> <c:out value="${material.factNum}" />
									</font>
  												 </c:when>

									<c:otherwise>  <c:out value="${material.factNum}" />
  													 </c:otherwise>

								</c:choose>

							</display:column>
							<display:column property="remark" sortable="true"
								headerClass="sortable" titleKey="materialForm.remark" />
							<display:column property="inputUser" sortable="true"
								headerClass="sortable" titleKey="materialForm.inputUser" />
							<display:column property="inputTime" sortable="true"
								headerClass="sortable" titleKey="materialForm.inputTime" />
							<display:column property="status" sortable="true"
								headerClass="sortable" titleKey="materialForm.status" />
							<display:column titleKey="table.operating">
								<a
									href="materials.html?method=edit&id=<c:out value="${material.id}"/>">修改</a>|
								    <a
									href="materials.html?method=delete&id=<c:out value="${material.id}"/>"
									onclick="bCancel=true; return confirmDelete('material')">删除</a>
							</display:column>
							<display:setProperty name="paging.banner.item_name"
								value="material" />
							<display:setProperty name="paging.banner.items_name"
								value="materials" />
						</display:table>
					</td>
				</tr>
			</table>

			<!---list end--->

		</td>
	</tr>
</table>
<script type="text/javascript">
    highlightTableRows("materialList");
</script>
